package com.thinkgem.jeesite.modules.accountinfo.web;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.modules.accountinfo.entity.AccountInfo;
import com.thinkgem.jeesite.modules.accountinfo.service.AccountInfoService;

@Controller
@RequestMapping(value = "${adminPath}/address")
public class AddressController extends BaseController{

    @Autowired
    private AccountInfoService accountInfoService;
    
    @RequiresPermissions("address:view")
    @RequestMapping(value = "")
    public String index() {
        return "modules/account/address/addressIndex";
    }
    
    @RequiresPermissions("address:view")
    @RequestMapping(value = "tree")
    public String tree(Model model) {
        model.addAttribute("categoryList", accountInfoService.findList(new AccountInfo()));
        return "modules/account/address/addressTree";
    }
    
    @RequiresPermissions("address:view")
    @RequestMapping(value = "none")
    public String none() {
        return "modules/account/address/addressNone";
    }
}
